Skip to content

Fix: add cross-platform changes to allow building on Windows#326

Open
bjones1 wants to merge 2 commits intoDoenet:mainfrom
bjones1:DAST-markdown
Open

Fix: add cross-platform changes to allow building on Windows#326
bjones1 wants to merge 2 commits intoDoenet:mainfrom
bjones1:DAST-markdown

Conversation

@bjones1
Copy link
Copy Markdown

@bjones1 bjones1 commented May 1, 2025

To get this running on Windows, I had to add a dependency on react-dom; otherwise, this caused conflicts when running npm update. As shown below, the dependency conflict stems from npm selecting the latest version of react-dom, which in turn select the latest react, which conflicts with v18 of react needed elsewhere.

Since this is my first Doenet PR, please let me know what changes are needed.

# npm resolution error report

While resolving: doenetml@1.0.0
Found: react@19.1.0
node_modules/react
  peer react@"^17.0.0 || ^18.0.0 || ^19.0.0" from @ariakit/react@0.4.17
  node_modules/@ariakit/react
    dev @ariakit/react@"^0.4.17" from the root project
  peer react@"^19.1.0" from react-dom@19.1.0
  node_modules/react-dom
    peer react-dom@"^17.0.0 || ^18.0.0 || ^19.0.0" from @ariakit/react@0.4.17
    node_modules/@ariakit/react
      dev @ariakit/react@"^0.4.17" from the root project
    peer react-dom@">=16.8.0" from @uiw/react-codemirror@4.23.12
    node_modules/@uiw/react-codemirror
      dev @uiw/react-codemirror@"^4.23.10" from the root project
    peer react-dom@">=18" from nextra@3.3.1
    node_modules/nextra
      dev nextra@"^3.3.1" from the root project
      nextra@"^3.3.1" from @doenet/docs-nextra@1.0.0
      packages/docs-nextra
        @doenet/docs-nextra@1.0.0
        node_modules/@doenet/docs-nextra
          workspace packages\docs-nextra from the root project
      peer nextra@"3.3.1" from nextra-theme-docs@3.3.1
      node_modules/nextra-theme-docs
        dev nextra-theme-docs@"^3.3.1" from the root project
        nextra-theme-docs@"^3.3.1" from @doenet/docs-nextra@1.0.0
        packages/docs-nextra
          @doenet/docs-nextra@1.0.0
          node_modules/@doenet/docs-nextra
            workspace packages\docs-nextra from the root project
    peer react-dom@"^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0" from next@15.3.1
    node_modules/next
      peer next@">=13" from nextra@3.3.1
      node_modules/nextra
        dev nextra@"^3.3.1" from the root project
        nextra@"^3.3.1" from @doenet/docs-nextra@1.0.0
        packages/docs-nextra
          @doenet/docs-nextra@1.0.0
          node_modules/@doenet/docs-nextra
            workspace packages\docs-nextra from the root project
        peer nextra@"3.3.1" from nextra-theme-docs@3.3.1
        node_modules/nextra-theme-docs
          dev nextra-theme-docs@"^3.3.1" from the root project
          nextra-theme-docs@"^3.3.1" from @doenet/docs-nextra@1.0.0
          packages/docs-nextra
            @doenet/docs-nextra@1.0.0
            node_modules/@doenet/docs-nextra
              workspace packages\docs-nextra from the root project
      peer next@">=13" from nextra-theme-docs@3.3.1
      node_modules/nextra-theme-docs
        dev nextra-theme-docs@"^3.3.1" from the root project
        nextra-theme-docs@"^3.3.1" from @doenet/docs-nextra@1.0.0
        packages/docs-nextra
          @doenet/docs-nextra@1.0.0
          node_modules/@doenet/docs-nextra
            workspace packages\docs-nextra from the root project
    peer react-dom@">=18" from nextra-theme-docs@3.3.1
    node_modules/nextra-theme-docs
      dev nextra-theme-docs@"^3.3.1" from the root project
      nextra-theme-docs@"^3.3.1" from @doenet/docs-nextra@1.0.0
      packages/docs-nextra
        @doenet/docs-nextra@1.0.0
        node_modules/@doenet/docs-nextra
          workspace packages\docs-nextra from the root project
    peer react-dom@">=16.14.0" from react-bootstrap@2.10.9
    node_modules/react-bootstrap
      dev react-bootstrap@"^2.10.9" from the root project
  peer react@">=16.3" from @fortawesome/react-fontawesome@0.2.2
  node_modules/@fortawesome/react-fontawesome
    dev @fortawesome/react-fontawesome@"^0.2.2" from the root project
    @fortawesome/react-fontawesome@"^0.2.2" from @doenet/doenetml@0.7.0-alpha40
    packages/doenetml
      @doenet/doenetml@0.7.0-alpha40
      node_modules/@doenet/doenetml
        workspace packages\doenetml from the root project
    @fortawesome/react-fontawesome@"^0.2.2" from @doenet/virtual-keyboard@*
    packages/virtual-keyboard
      @doenet/virtual-keyboard@*
      node_modules/@doenet/virtual-keyboard
        workspace packages\virtual-keyboard from the root project
  peerOptional react@"^16.9.0 || ^17.0.0 || ^18 || ^19" from @reduxjs/toolkit@2.7.0
  node_modules/@reduxjs/toolkit
    dev @reduxjs/toolkit@"^2.6.1" from the root project
  peer react@">=16.8.0" from @uiw/react-codemirror@4.23.12
  node_modules/@uiw/react-codemirror
    dev @uiw/react-codemirror@"^4.23.10" from the root project
  peer react@">=18" from nextra@3.3.1
  node_modules/nextra
    dev nextra@"^3.3.1" from the root project
    nextra@"^3.3.1" from @doenet/docs-nextra@1.0.0
    packages/docs-nextra
      @doenet/docs-nextra@1.0.0
      node_modules/@doenet/docs-nextra
        workspace packages\docs-nextra from the root project
    peer nextra@"3.3.1" from nextra-theme-docs@3.3.1
    node_modules/nextra-theme-docs
      dev nextra-theme-docs@"^3.3.1" from the root project
      nextra-theme-docs@"^3.3.1" from @doenet/docs-nextra@1.0.0
      packages/docs-nextra
        @doenet/docs-nextra@1.0.0
        node_modules/@doenet/docs-nextra
          workspace packages\docs-nextra from the root project
  peer react@"^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0" from next@15.3.1
  node_modules/next
    peer next@">=13" from nextra@3.3.1
    node_modules/nextra
      dev nextra@"^3.3.1" from the root project
      nextra@"^3.3.1" from @doenet/docs-nextra@1.0.0
      packages/docs-nextra
        @doenet/docs-nextra@1.0.0
        node_modules/@doenet/docs-nextra
          workspace packages\docs-nextra from the root project
      peer nextra@"3.3.1" from nextra-theme-docs@3.3.1
      node_modules/nextra-theme-docs
        dev nextra-theme-docs@"^3.3.1" from the root project
        nextra-theme-docs@"^3.3.1" from @doenet/docs-nextra@1.0.0
        packages/docs-nextra
          @doenet/docs-nextra@1.0.0
          node_modules/@doenet/docs-nextra
            workspace packages\docs-nextra from the root project
    peer next@">=13" from nextra-theme-docs@3.3.1
    node_modules/nextra-theme-docs
      dev nextra-theme-docs@"^3.3.1" from the root project
      nextra-theme-docs@"^3.3.1" from @doenet/docs-nextra@1.0.0
      packages/docs-nextra
        @doenet/docs-nextra@1.0.0
        node_modules/@doenet/docs-nextra
          workspace packages\docs-nextra from the root project
  peer react@">=18" from nextra-theme-docs@3.3.1
  node_modules/nextra-theme-docs
    dev nextra-theme-docs@"^3.3.1" from the root project
    nextra-theme-docs@"^3.3.1" from @doenet/docs-nextra@1.0.0
    packages/docs-nextra
      @doenet/docs-nextra@1.0.0
      node_modules/@doenet/docs-nextra
        workspace packages\docs-nextra from the root project
  peer react@">=16.14.0" from react-bootstrap@2.10.9
  node_modules/react-bootstrap
    dev react-bootstrap@"^2.10.9" from the root project
  peer react@"*" from react-icons@5.5.0
  node_modules/react-icons
    dev react-icons@"^5.5.0" from the root project
    react-icons@"^5.5.0" from @doenet/doenetml@0.7.0-alpha40
    packages/doenetml
      @doenet/doenetml@0.7.0-alpha40
      node_modules/@doenet/doenetml
        workspace packages\doenetml from the root project
    react-icons@"^5.5.0" from @doenet/virtual-keyboard@*
    packages/virtual-keyboard
      @doenet/virtual-keyboard@*
      node_modules/@doenet/virtual-keyboard
        workspace packages\virtual-keyboard from the root project

Could not resolve dependency:
dev react-reconciler@"^0.29.2" from the root project

Conflicting peer dependency: react@18.3.1
node_modules/react
  peer react@"^18.3.1" from react-reconciler@0.29.2
  node_modules/react-reconciler
    dev react-reconciler@"^0.29.2" from the root project

@siefkenj
Copy link
Copy Markdown
Contributor

siefkenj commented May 2, 2025

I'm confused why react-dom needed to be added. Did npm install not work?

@bjones1
Copy link
Copy Markdown
Author

bjones1 commented May 2, 2025

I'm confused why react-dom needed to be added. Did npm install not work?

On Windows: npm install works, but npm run build fails, since the existing package-lock.json file doesn't have win32 wasm toold installed. npm update then fails with the error above, without this additional dependency. With this depedancy, npm update then npm run build now succeeds.

On Linux: npm install then npm run build works, but npm run dev fails (but this looks like a separate issue).

@siefkenj
Copy link
Copy Markdown
Contributor

siefkenj commented May 2, 2025

Are you able to develop on Linux/WSL? There are several other build scripts that assume a unix-like environment. I think supporting a windows dev environment will be a lot more trouble than its worth...

@bjones1
Copy link
Copy Markdown
Author

bjones1 commented May 2, 2025

Yes, I run WSL also. However, I'd suggest gradually merging changes that don't impact Linux/OS X while allowing pieces of Windows to work. I think a long-term goal of Windows support would enlarge the pool of potential project contributors.

@FaeBuczek
Copy link
Copy Markdown
Contributor

I would appreciate Windows support for Doenet dev environments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants